'''
Created on 2012-10-6

@author: infear
'''
import re;

some_text='a1,b,c d'
print re.split(pattern="[, ]", string=some_text, maxsplit=3, flags=0)
print re.findall(pattern='[a-zA-Z]+$', string=some_text, flags=0)
emphasis_pattern=r'\*([^\*]+)\*'
helloWorld='hello,*world*'
print re.sub(pattern=emphasis_pattern, repl=r'<em>\1</em>', string=helloWorld, count=0, flags=0)
rstr=r'www\.([^\.]+)\.com'
matchObject=re.match(pattern=rstr, string="www.renren.com", flags=0);
if matchObject is not None:
    print matchObject.group(1)